package com.itheima.reggie.service;

import com.itheima.reggie.entity.ShoppingCart;

import java.util.List;

/**
 * @Author: qingtao
 * @Date 2022/3/22 20:04
 */
public interface ShoppingCartService {

    /**
     * 添加购物车
     * @param shoppingCart
     * @return
     */
    ShoppingCart add(ShoppingCart shoppingCart);

    /**
     * 减少
     * @param shoppingCart
     * @return
     */
    ShoppingCart sub(ShoppingCart shoppingCart);

    /**
     * 根据userID查找菜品
     * @param userId
     * @return
     */
    List<ShoppingCart> findCartByUserId(Long userId);

    /**
     * 清空购物车
     * 根据userId
     * @param userId
     * @return
     */
    boolean clear(Long userId);
}
